package com.csaba.connector.model;

public class Partner extends AbstractRemoteObject
{
	private static final long serialVersionUID = 3579950124302776815L;

	private Customer owner;
	private String nickName;
	private String name;
	private String address;
	private Country country;
	private PartnerBank bank;
	private String accountNumber;

	public String getNickName()
	{
		return nickName;
	}

	public void setNickName( final String nickName )
	{
		this.nickName = nickName;
	}

	public String getName()
	{
		return name;
	}

	public void setName( final String name )
	{
		this.name = name;
	}

	public String getAddress()
	{
		return address;
	}

	public void setAddress( final String address )
	{
		this.address = address;
	}

	public Country getCountry()
	{
		return country;
	}

	public void setCountry( final Country country )
	{
		this.country = country;
	}

	public String getAccountNumber()
	{
		return accountNumber;
	}

	public void setAccountNumber( final String accountNumber )
	{
		this.accountNumber = accountNumber;
	}

	public void setOwner( final Customer owner )
	{
		this.owner = owner;
	}

	public Customer getOwner()
	{
		return owner;
	}

	@Override
	public boolean equals( final Object arg0 )
	{
		if ( arg0 != null && arg0 instanceof Partner )
		{
			final Partner other = (Partner) arg0;
			return owner.equals(other.owner) && accountNumber.equals(other.accountNumber);
		}
		return false;
	}

	@Override
	public String toString()
	{
		return nickName + "[" + accountNumber + "]";
	}

	public void setBank( final PartnerBank bank )
	{
		this.bank = bank;
	}

	public PartnerBank getBank()
	{
		return bank;
	}
}
